home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19990422-19990725
/
000154_news@watsun.cc.columbia.edu _Mon Jun 14 12:52:52 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Return-Path: <news@watsun.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id MAA27935
for <kermit.misc@watsun.cc.columbia.edu>; Mon, 14 Jun 1999 12:52:52 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id JAA27457
for kermit.misc@watsun.cc.columbia.edu; Mon, 14 Jun 1999 09:56:00 -0400 (EDT)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Subject: Re: c-kermit output to stderr on linux
Date: 14 Jun 1999 13:55:59 GMT
Organization: Columbia University
Message-ID: <7k31lf$qpv$1@newsmaster.cc.columbia.edu>
To: kermit.misc@watsun.cc.columbia.edu
In article <3765058E.C11E22C6@asares.com>,
Brian J. Corcoran <corcoran@asares.com> wrote:
: Frank da Cruz wrote:
: > In article <3762DA05.B12F366E@asares.com>,
: > Brian J. Corcoran <corcoran@asares.com> wrote:
: > : I'm trying to get a kermit script to output info to stderr with the
: > : following command:
: > :
: > : writeln error {text line}
: > :
: > : ...but it's still outputing to stdout. Can anybody help with this?
: > :
: > You're right, it seems to be doing that. Yet the code is using
: > "fprintf(stderr,...)" in this case. The reason that the text is not
: > actually going to stderr is not obvious.
: >
: > : If I can't get around the problem this way, is there an easy way to
: > : suppress all output from a script, except for certain text?
: > :
: > WRITE[LN] ERROR should be the way to do it. However, a workaround (for
: > UNIX) would be:
: >
: > open write /dev/tty
: >
: > and then use WRITE (or WRITELN) FILE.
:
: ah, but that still sends to stdout, rather than stderr, no? I think I've
: found a work-around by using a similar concept, using a dedicated named
: pipe.
:
If I make a script file, x, containing:
#!./wermit
open write /dev/tty
if fail exit
writeln screen (1) This is written to stdout.
writeln error (2) This is written to stderr.
writeln file (3) This is written to /dev/tty.
And then in Bash:
$ chmod +x ./x
$ ./x > foo
I get:
(3) This is written to /dev/tty.
on the screen and:
(1) This is written to stdout.
(2) This is written to stderr..
written to foo.
: > : Finally, I've noticed writeln/write-line behaves as write when
: > : outputting to stdout (it doesn't include the new-line character). Is
: > : this correct behavior?
: > :
: > No, it's a bug. This will be corrected in the next Beta edit. Hopefully
: > by then I will also have figured out why writes to sdterr are not going
: > to stderr.
: >
: > I suspect there must be code somewhere that sends stderr to stdout so
: > error messages will come out in sequence with other text, rather than
: > butting ahead, but the spot is not obvious. Anyway, if this was done,
: > it was probably done for a reason and so fixing it will no doubt break
: > something else. I'll try to sort this out in the next Beta.
:
This was identified and fixed yesterday; the fix will be in Beta.08.
So now:
$ ./x > y
(2) This is written to stderr.
(3) This is written to /dev/tty.
$ ./x 2> y
(1) This is written to stdout.
(3) This is written to /dev/tty.
$
- Frank